home *** CD-ROM | disk | FTP | other *** search
Gui4CLI script | 1980-01-03 | 3.0 KB | 103 lines |
- G4C
-
- ; DIRECTORY LISTVIEWS
-
- ; A directory lv is like the listers you find in DirOpus and other
- ; file managers. They are multi-selectable and have dedicated
- ; commands. There is much more that can be done with them than
- ; is shown here.. (look at dir.gc)
-
-
- WINBIG 156 31 300 177 ListViews3.gc
- WinType 11110001
-
- xOnLoad
- GuiOpen ListViews3.gc
-
- xOnClose
- GuiQuit ListViews3.gc
-
- ; ----------------------- The directory listview
-
- ; Note that (like multi-lv's) these lv's "happen" when the user
- ; double clicks them.
-
- ; In this case, if the item double-clicked is
- ; a directory, then the dir will be entered into automatically
- ; and the xLVDirHook event will be executed.
-
- ; If it's a file, then the commands attached to the LV (none in
- ; this case) would be executed. The name of the file would be
- ; in the "lv.file" variable.
-
- ; The items in a dir lv need to be line-up, so they look nicer,
- ; that's why we declare a fixed width (topaz8) font for this gadget.
-
-
- XLISTVIEW 5 2 207 172 "" lv.file "" 10 DIR
- gadid 1 ; the ID of our listview
- gadfont topaz.font 8 000 ; you can give any font you want
- lvdirhook 1 ; the number of the LVDirHook event
- ; that will be executed whenever a
- ; directory is double-clicked
-
- ; This is the xLVDirHook event that will be executed on double-clicking
- ; a directory - we use it to update the window's title with the name
- ; of the directory our listview is at.
-
- xLVDirHook 1
- setwintitle listviews3.gc '$$lv.dir '
-
-
- ; ----------------------- The buttons..
-
- ; These buttons will control our dir listview..
-
-
- XBUTTON 215 2 81 14 "Parent" ; go to the parent dir
- lvuse listviews3.gc 1
- lvdir parent
- setwintitle listviews3.gc '$$lv.dir '
-
- XBUTTON 215 16 81 14 "Root" ; go to the root of the drive
- lvuse listviews3.gc 1
- lvdir root
- setwintitle listviews3.gc '$$lv.dir '
-
- XBUTTON 215 30 81 14 "Disks" ; show the device list
- lvuse listviews3.gc 1
- lvdir disks
- setwintitle listviews3.gc 'Device list'
-
-
- XBUTTON 215 50 81 14 "All" ; select all dirs/files
- lvuse listviews3.gc 1
- lvdir all
-
- XBUTTON 215 64 81 14 "None" ; unselect all selected items
- lvuse listviews3.gc 1
- lvdir none
-
-
- ; This button will list out all the selected items, stating what
- ; type they are.. Note that the device list can never be acted upon..
- ; It's done for safety, so that gems like "delete DH0:" can be avoided
-
- XBUTTON 215 88 81 14 "List"
- lvuse listviews3.gc 1 ; use our listview
- lvmulti first ; goto to first selected item
- while $$lv.line > '' ; while there are selected items..
- say '$$lv.type - $$lv.rec\n' ; show the type & name of each item
- lvmulti off ; un-select the item
- lvmulti next ; get next item
- endwhile ; until no more..
-
-
-
- ; Easy, wasn't it ? - Now try doing this in C.
- ; (see you next year..)
-
-
-
-
-